#ifndef __LIB_AGORA_ADMIN_CHANNEL_H__
#define __LIB_AGORA_ADMIN_CHANNEL_H__

#include "AdminIChannel.h"

namespace AgoraAdmin
{

	class	Channel : public IChannel
	{
	public:
		Channel(const unsigned int id, IChannel* parent, const unsigned int idParent, const std::string& name, const unsigned int maxNameLenght, const std::string& password, const unsigned int maxPasswordLenght, const std::string& motd, const unsigned int maxMotdLenght, const std::string& description, const unsigned int maxDescriptionLenght, const bool visible, const unsigned int maxUser, const unsigned int maxTalker);
		~Channel(void);

		const unsigned int					GetId(void) const;
		IChannel*							GetParent(void) const;
		const unsigned int					GetParentId(void) const;
		void								SetParent(IChannel* parent);
		void								SetParentNODB(IChannel* parent);
		const bool							HaveParent(void) const;
		const std::string&					GetName(void) const;
		void								SetName(const std::string& name);
		const unsigned int					GetMaxNameLength(void) const;
		void								SetMaxNameLength(const unsigned int length, bool recurcive);
		const std::string&					GetPassword(void) const;
		void								SetPassword(const std::string& password, bool recurcive);
		const unsigned int					GetMaxPasswordLength(void) const;
		void								SetMaxPasswordLength(const unsigned int length, bool recurcive);
		const std::string&					GetMotd(void) const;
		void								SetMotd(const std::string& motd, bool recurcive);
		const unsigned int					GetMaxMotdLength(void) const;
		void								SetMaxMotdLength(const unsigned int length, bool recurcive);
		const std::string&					GetDescription(void) const;
		void								SetDescription(const std::string& description, bool recurcive);
		const unsigned int					GetMaxDescriptionLength(void) const;
		void								SetMaxDescriptionLength(const unsigned int length, bool recurcive);
		const bool							GetVisibility(void) const;
		void								SetVisibility(const bool visible, bool recurcive);
		const unsigned int					GetMaxUser(void) const;
		void								SetMaxUser(const unsigned int limit, bool recurcive);
		const unsigned int					GetMaxTalker(void) const;
		void								SetMaxTalker(const unsigned int limit, bool recurcive);

		void								DeleteChannel(void);
		void								AddChannelChild(IChannel* channel);
		void								RemoveChannelChild(IChannel* channel);
		std::list<IChannel*>&				GetChannelChild(void);
		void								AddUser(IUser* user);
		void								RemoveUser(IUser* user);
		std::list<IUser*>&					GetUser();
		std::list<unsigned int>&			GetBanList();
		void								AddBanList(const unsigned int idUser);
		void								RemoveBanList(const unsigned int idUser);
		bool								UserIsBan(const unsigned int idUser);
		std::map<unsigned int, IUser*>&		GetMuteMap();
		std::list<IUser*>&					GetMuteList();
		void								AddMuteUser(IUser* user);
		void								RemoveMuteUser(IUser* user);
		bool								UserIsMute(IUser* user);

	private:
		unsigned int						_id;
		IChannel*							_parent;
		unsigned int						_idParent;
		std::string							_name;
		unsigned int						_maxNameLenght;
		std::string							_password;
		unsigned int						_maxPasswordLenght;
		std::string							_motd;
		unsigned int						_maxMotdLenght;
		std::string							_description;
		unsigned int						_maxDescriptionLenght;
		bool								_visible;
		unsigned int						_maxUser;
		unsigned int						_maxTalker;
		std::list<IChannel*>				_child;
		std::list<IUser*>					_user;
		std::list<unsigned int>				_banList;
		std::map<unsigned int, IUser*>		_muteList;
	};

}

#endif